package com.alipay.demo.trade.utils;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import org.apache.commons.lang3.StringUtils;

public class Utils {

   public static String toAmount(long amount) {
      return (new BigDecimal(amount)).divide(new BigDecimal(100)).toString();
   }

   public static String toDate(Date date) {
      return (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
   }

   public static boolean isEmpty(Object object) {
      return object instanceof String?StringUtils.isEmpty((String)object):object == null;
   }

   public static boolean isNotEmpty(Object object) {
      return !isEmpty(object);
   }

   public static boolean isListNotEmpty(List list) {
      return list != null && list.size() > 0;
   }

   public static boolean isListEmpty(List list) {
      return !isListNotEmpty(list);
   }

   public static void sleep(long time) {
      try {
         Thread.sleep(time);
      } catch (InterruptedException var3) {
         var3.printStackTrace();
      }

   }
}
